import request from '@/utils/request'
// 获取房产列表
export function getPropertiesList(params) {
  return request({
    url: '/properties',
    method: 'get',
    params
  })
}
// 获取房产数量
export function getPropertiesCount(params) {
  return request({
    url: '/properties/count',
    method: 'get',
    params
  })
}
// 登录
export function login(data) {
  return request({
    url: '/auth/local',
    method: 'post',
    data
  })
}
// 新建房产
export function addProperties(data) {
  return request({
    url: '/properties',
    method: 'post',
    data
  })
}
// 删除房产
export function delProperties(id) {
  return request({
    url: `/properties/${id}`,
    method: 'DELETE'
  })
}
// 根据id获取指定房产
export function getPropertiesListById(id) {
  return request({
    url: `/properties/${id}`,
    method: 'get'
  })
}
// 编辑房产
export function updatePropertiesListById(data) {
  return request({
    url: `/properties/${data.id}`,
    method: 'put',
    data
  })
}
